package com.visizen.wisdomclass.server.client;

import com.visizen.wisdomclass.server.model.WcLocateRange;
import com.visizen.wisdomclass.server.model.WcLocateRangeExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WcLocateRangeMapper {
    @SelectProvider(type=WcLocateRangeSqlProvider.class, method="countByExample")
    int countByExample(WcLocateRangeExample example);

    @DeleteProvider(type=WcLocateRangeSqlProvider.class, method="deleteByExample")
    int deleteByExample(WcLocateRangeExample example);

    @Delete({
        "delete from wc_locate_range",
        "where SET_ID = #{SET_ID,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long SET_ID);

    @Insert({
        "insert into wc_locate_range (SET_ID, USER_ID, ",
        "RADIUS)",
        "values (#{SET_ID,jdbcType=BIGINT}, #{USER_ID,jdbcType=BIGINT}, ",
        "#{RADIUS,jdbcType=INTEGER})"
    })
    int insert(WcLocateRange record);

    @InsertProvider(type=WcLocateRangeSqlProvider.class, method="insertSelective")
    int insertSelective(WcLocateRange record);

    @SelectProvider(type=WcLocateRangeSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="SET_ID", property="SET_ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="USER_ID", property="USER_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="RADIUS", property="RADIUS", jdbcType=JdbcType.INTEGER)
    })
    List<WcLocateRange> selectByExample(WcLocateRangeExample example);

    @Select({
        "select",
        "SET_ID, USER_ID, RADIUS",
        "from wc_locate_range",
        "where SET_ID = #{SET_ID,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="SET_ID", property="SET_ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="USER_ID", property="USER_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="RADIUS", property="RADIUS", jdbcType=JdbcType.INTEGER)
    })
    WcLocateRange selectByPrimaryKey(Long SET_ID);

    @UpdateProvider(type=WcLocateRangeSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") WcLocateRange record, @Param("example") WcLocateRangeExample example);

    @UpdateProvider(type=WcLocateRangeSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") WcLocateRange record, @Param("example") WcLocateRangeExample example);

    @UpdateProvider(type=WcLocateRangeSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(WcLocateRange record);

    @Update({
        "update wc_locate_range",
        "set USER_ID = #{USER_ID,jdbcType=BIGINT},",
          "RADIUS = #{RADIUS,jdbcType=INTEGER}",
        "where SET_ID = #{SET_ID,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(WcLocateRange record);
}